{literal}
    <style>
        .uerror{
            color: red;
            font-family: Tahoma;
            font-size: 10pt;
            font-weight: bold;
            margin-left: 20px;
        } 
    </style>

    <script type="text/javascript">
    function hideAllErrors() 
    {
        document.getElementById("titleError").style.display = "none"
        document.getElementById("artistError").style.display = "none"
        document.getElementById("tagsError").style.display = "none"
        document.getElementById("viewsError").style.display = "none"
        document.getElementById("downloadError").style.display = "none"
        document.getElementById("votesError").style.display = "none"
        document.getElementById("ratingError").style.display = "none"    
        document.getElementById("dateError").style.display = "none"   
        document.getElementById("countryError").style.display = "none"   
            
            
    }    
    function checkuploadForm() {
            
      title = document.getElementById("title").value;
      artist = document.getElementById("artist").value;    
      tags = document.getElementById("tags").value;    
      views = document.getElementById("viewcount").value;         
      downloads = document.getElementById("downloadcount").value;         
      votes = document.getElementById("ratingcount").value;         
      ratings = document.getElementById("rating").value;   
          
      month = document.getElementById("month").value;      
      day = document.getElementById("day").value;      
      year = document.getElementById("year").value;    
      
      country = document.getElementById("country").value;    
      
      completeDate= month +"/"+ day+"/"+year;    
      dateRegEx = /((0[13578]|1[02])[\/.]31[\/.](18|19|20)[0-9]{2})|((01|0[3-9]|1[1-2])[\/.](29|30)[\/.](18|19|20)[0-9]{2})|((0[1-9]|1[0-2])[\/.](0[1-9]|1[0-9]|2[0-8])[\/.](18|19|20)[0-9]{2})|((02)[\/.]29[\/.](((18|19|20)(04|08|[2468][048]|[13579][26]))|2000))/;            
        
      if (title == "")
        {
                hideAllErrors();
                document.getElementById("titleError").style.display = "block";
                document.getElementById("title").select();
                document.getElementById("title").focus();
                return false;
        }
      else if (artist == "")
        {
                hideAllErrors();
                document.getElementById("artistError").style.display = "block";
                document.getElementById("artist").select();
                document.getElementById("artist").focus();
                return false;
        }
      else if (country == "")
        {
                hideAllErrors();
                document.getElementById("countryError").style.display = "block";
                document.getElementById("country").select();
                document.getElementById("country").focus();
                return false;
        }
       else if (tags == "")
        {
                hideAllErrors();
                document.getElementById("tagsError").style.display = "block";
                document.getElementById("tags").select();
                document.getElementById("tags").focus();
                return false;
        }
      else if (views == "" || isNaN(views))
        {
                hideAllErrors();
                document.getElementById("viewsError").style.display = "block";
                document.getElementById("views").select();
                document.getElementById("views").focus();
                return false;
        }
      else if (downloads == "" || isNaN(downloads))
        {
                hideAllErrors();
                document.getElementById("downloadError").style.display = "block";
                document.getElementById("downloadcount").select();
                document.getElementById("downloadcount").focus();
                return false;
        }
      else if (votes == "" || isNaN(votes))
        {
                hideAllErrors();
                document.getElementById("votesError").style.display = "block";
                document.getElementById("ratingcount").select();
                document.getElementById("ratingcount").focus();
                return false;
        }
      else if (ratings == "" || isNaN(ratings))
        {
                hideAllErrors();
                document.getElementById("ratingError").style.display = "block";
                document.getElementById("rating").select();
                document.getElementById("rating").focus();
                return false;
        }
      else if(dateRegEx.test(completeDate)==false){
                hideAllErrors();
                document.getElementById("dateError").style.display = "block";
                document.getElementById("day").select();
                document.getElementById("day").focus();
                return false;
          
       }
      else    {
        document.main_form.submit();
        //return true;    
      }
    }
    </script>
{/literal}
<div class="middle" id="anchor-content">
    <div id="page:main-container">
        <div class="columns ">

            <div class="side-col" id="page:left">
                <h3>Audios</h3>

                <ul id="isoft" class="tabs">
                    <li >
                        <a href="audios_manage.php" id="isoft_group_1" name="group_1" title="Manage Audios" class="tab-item-link ">
                            <span>
                                <span class="changed" title=""></span>
                                <span class="error" title=""></span>
                                Manage Audios
                            </span>
                        </a>

                        <div id="isoft_group_1_content" style="display:none;">
                            <div class="entry-edit">
                                <div class="entry-edit-head">
                                    <h4 class="icon-head head-edit-form fieldset-legend">Edit Video</h4>
                                    <div class="form-buttons">

                                    </div>
                                </div>

                                <fieldset id="group_fields4">
                                    <div class="hor-scroll">
                                        <table cellspacing="0" class="form-list">
                                            <tbody>
                                                <tr class="hidden">
                                                    <td class="label"><label for="name">Video ID </label></td>
                                                    <td class="value">
                                                        {$audio.AUDIOID}
                                                    </td>
                                                    <td class="scope-label"></td>
                                                    <td><small></small></td>
                                                </tr>
                                                <tr class="hidden">
                                                    <td class="label"><label for="status">Owner </label></td>
                                                    <td class="value">
                                                        <select name="USERID" id="USERID">
                                                            {insert name=get_all_members assign=listallmembers}
                                                            {section name=i loop=$listallmembers}
                                                                <option value="{$listallmembers[i].USERID}" {if $audio.USERID eq $listallmembers[i].USERID}selected{/if}>{$listallmembers[i].username}</option>
                                                            {/section}
                                                        </select>
                                                    </td>
                                                    <td class="scope-label">[OWNER OF THE AUDIO]</td>
                                                    <td><small></small></td>
                                                </tr>
                                                <tr class="hidden">
                                                    <td class="label"><label for="name">Title </label></td>
                                                    <td class="value">
                                                        <input id="title" name="title" value="{$audio.title|stripslashes}" class=" required-entry required-entry input-text" type="text"/>
                                                        <div class="uerror" id="titleError" style="display:none;">Error: Title cannot be empty.</div>
                                                    </td>
                                                    <td class="scope-label">[TITLE OF THE AUDIO]</td>
                                                    <td><small></small></td>
                                                </tr>

                                                <tr class="hidden">
                                                    <td class="label"><label for="name">Artist </label></td>
                                                    <td class="value">
                                                        <input id="artist" name="artist" value="{$audio.artist|stripslashes}" class=" required-entry required-entry input-text" type="text"/>
                                                        <div class="uerror" id="artistError" style="display:none;">Error: Artist name cannot be empty.</div>
                                                    </td>
                                                    <td class="scope-label">[ARTIST OF THE AUDIO]</td>
                                                    <td><small></small></td>
                                                </tr> 

                                                <tr class="hidden">
                                                    <td class="label"><label for="name">Country </label></td>
                                                    <td class="value">
                                                        <select id="country" name="country">
                                                            <option value="">Select country</option>
                                                            {$countriesList}
                                                        </select>
                                                        <div class="uerror" id="countryError" style="display:none;">Error: Please select a country.</div>    
                                                    </td>
                                                    <td class="scope-label">[COUNTRY OF THE ARTIST]</td>
                                                    <td><small></small></td>
                                                </tr> 

                                           
                                            
                                            <tr class="hidden">
                                                <td class="label"><label for="name">Description </label></td>
                                                <td class="value">
                                                    <textarea id="vdescription" name="vdescription" class=" textarea" type="textarea" >{$audio.description|stripslashes}</textarea>
                                                </td>
                                                <td class="scope-label">[DESCRIPTION OF THE AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="name">Tags </label></td>
                                                <td class="value">
                                                    <input id="tags" name="tags" value="{$audio.tags|stripslashes}" class=" required-entry required-entry input-text" type="text"/>
                                                    <div class="uerror" id="tagsError" style="display:none;">Error: Tags cannot be empty.</div>
                                                </td>
                                                <td class="scope-label">[TAGS OF THE AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Category </label></td>
                                                <td class="value">
                                                    <select name="categories" id="categories">
                                                        {insert name=get_all_cats assign=listallcats}
                                                        {section name=i loop=$listallcats}
                                                            <option value="{$listallcats[i].CATID}" {if $audio.categories eq $listallcats[i].CATID}selected{/if}>{$listallcats[i].name|stripslashes}</option>
                                                        {/section}
                                                    </select>
                                                </td>
                                                <td class="scope-label">[OWNER OF THE AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Broadcast </label></td>
                                                <td class="value">
                                                    <select name="public" id="public">
                                                        <option value="1" {if $audio.public eq 1}selected{/if}>Public</option>
                                                        <option value="0" {if $audio.public eq 0}selected{/if}>Private</option>
                                                    </select>
                                                </td>
                                                <td class="scope-label">[WHO CAN VIEW THIS AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="name">Date Added </label></td>
                                                <td class="value" colspan="2">
                                                    {*$audio.time_added|date_format:"%b %e, %Y"*}
                                                    <div style="width:20%;float:left;"> 
                                                        <select style="width:85px" id="day" name="day">
                                                            <option value="">Select day</option>
                                                            {$dayList} 
                                                        </select>
                                                    </div>
                                                    <div style="width:23%;float:left;"> 
                                                        <select style="width:100px" id="month" name="month">
                                                            <option value="">Select month</option>
                                                            {$monthList} 
                                                        </select>
                                                    </div>
                                                    <div style="width:20%;float:left;"> 
                                                        <select style="width:85px" id="year" name="year">
                                                            <option value="">Select Year</option>
                                                            {$yearList}
                                                        </select>
                                                    </div>
                                                    <div style="clear:both;"></div>    
                                                    <div class="uerror" id="dateError" style="display:none;">Error: Please select proper date.</div>
                                                </td>
                                                <td class="scope-label"></td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="name">Views </label></td>
                                                <td class="value">
                                                    <input id="viewcount" name="viewcount" value="{$audio.viewcount}" class=" required-entry required-entry input-text" type="text"/>
                                                    <div class="uerror" id="viewsError" style="display:none;">Error: View count cannot be empty and should be numeric.</div>
                                                </td>
                                                <td class="scope-label">[AUDIO VIEWS]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="name">Downloads </label></td>
                                                <td class="value">
                                                    <input id="downloadcount" name="downloadcount" value="{$audio.downloadcount}" class=" required-entry required-entry input-text" type="text"/>
                                                    <div class="uerror" id="downloadError" style="display:none;">Error: Download count cannot be empty and should be numeric.</div>
                                                </td>
                                                <td class="scope-label">[AUDIO DOWNLOADS]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Featured </label></td>
                                                <td class="value">
                                                    <select name="featured" id="featured">
                                                        <option value="1" {if $audio.featured eq 1}selected{/if}>Yes</option>
                                                        <option value="0" {if $audio.featured eq 0}selected{/if}>No</option>
                                                    </select>
                                                </td>
                                                <td class="scope-label">[FEATURE THE AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="name">Votes </label></td>
                                                <td class="value">
                                                    <input id="ratingcount" name="ratingcount" value="{$audio.ratingcount}" class=" required-entry required-entry input-text" type="text"/>
                                                    <div class="uerror" id="votesError" style="display:none;">Error: Votes count cannot be empty and should be numeric.</div>
                                                </td>
                                                <td class="scope-label">[NUMBER OF MEMBERS WHO RATED THE AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="name">Rating </label></td>
                                                <td class="value">
                                                    <input id="rating" name="rating" value="{$audio.rating}" class=" required-entry required-entry input-text" type="text"/>
                                                    <div class="uerror" id="ratingError" style="display:none;">Error: Ratings cannot be empty and should be numeric.</div>
                                                </td>
                                                <td class="scope-label">[AVERAGE AUDIO RATING]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Allow Comments </label></td>
                                                <td class="value">
                                                    <select name="allowcomments" id="allowcomments">
                                                        <option value="1" {if $audio.allowcomments eq 1}selected{/if}>Yes</option>
                                                        <option value="0" {if $audio.allowcomments eq 0}selected{/if}>No</option>
                                                    </select>
                                                </td>
                                                <td class="scope-label">[ALLOW COMMENTS FOR THIS AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Allow Ratings </label></td>
                                                <td class="value">
                                                    <select name="allowratings" id="allowratings">
                                                        <option value="1" {if $audio.allowratings eq 1}selected{/if}>Yes</option>
                                                        <option value="0" {if $audio.allowratings eq 0}selected{/if}>No</option>
                                                    </select>
                                                </td>
                                                <td class="scope-label">[ALLOW RATINGS FOR THIS AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Allow Embeds </label></td>
                                                <td class="value">
                                                    <select name="allowembeds" id="allowembeds">
                                                        <option value="1" {if $audio.allowembeds eq 1}selected{/if}>Yes</option>
                                                        <option value="0" {if $audio.allowembeds eq 0}selected{/if}>No</option>
                                                    </select>
                                                </td>
                                                <td class="scope-label">[ALLOW EMBEDS FOR THIS AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Allow Downloads </label></td>
                                                <td class="value">
                                                    <select name="allowdownloads" id="allowdownloads">
                                                        <option value="1" {if $audio.allowdownloads eq 1}selected{/if}>Yes</option>
                                                        <option value="0" {if $audio.allowdownloads eq 0}selected{/if}>No</option>
                                                    </select>
                                                </td>
                                                <td class="scope-label">[ALLOW DOWNLOADS FOR THIS AUDIO]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Active </label></td>
                                                <td class="value">
                                                    <select name="active" id="active">
                                                        <option value="1" {if $audio.active eq 1}selected{/if}>Yes</option>
                                                        <option value="0" {if $audio.active eq 0}selected{/if}>No</option>
                                                    </select>
                                                </td>
                                                <td class="scope-label">[AUDIO STATUS]</td>
                                                <td><small></small></td>
                                            </tr>
                                            <tr class="hidden">
                                                <td class="label"><label for="status">Mature </label></td>
                                                <td class="value">
                                                    <select name="mature" id="mature">
                                                        <option value="1" {if $audio.mature eq 1}selected{/if}>Yes</option>
                                                        <option value="0" {if $audio.mature eq 0}selected{/if}>No</option>
                                                    </select>
                                                </td>
                                                <td class="scope-label">[SUITABLE FOR ADULTS ONLY]</td>
                                                <td><small></small></td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </fieldset>
                            </div>
                        </div>


























                    </li>

                    <li >
                        <a href="audios_validate.php" id="isoft_group_2" name="group_2" title="Validate Audios" class="tab-item-link">
                            <span>
                                <span class="changed" title=""></span>
                                <span class="error" title=""></span>
                                Validate Audios
                            </span>
                        </a>
                        <div id="isoft_group_2_content" style="display:none;"></div>
                    </li>

                    <li >
                        <a href="audios_featured.php" id="isoft_group_3" name="group_3" title="Featured Audios" class="tab-item-link">
                            <span>
                                <span class="changed" title=""></span>
                                <span class="error" title=""></span>
                                Featured Audios
                            </span>
                        </a>
                        <div id="isoft_group_3_content" style="display:none;"></div>
                    </li>

                    <li >
                        <a href="audios_reported.php" id="isoft_group_4" name="group_4" title="Reported Audios" class="tab-item-link">
                            <span>
                                <span class="changed" title=""></span>
                                <span class="error" title=""></span>
                                Reported Audios
                            </span>
                        </a>
                        <div id="isoft_group_4_content" style="display:none;"></div>
                    </li>

                </ul>

                <script type="text/javascript">
                    isoftJsTabs = new varienTabs('isoft', 'main_form', 'isoft_group_1', []);
                </script>

            </div>

            <div class="main-col" id="content">
                <div class="main-col-inner">
                    <div id="messages">
                        {if $message ne "" OR $error ne ""}
                            {include file="administrator/show_message.tpl"}
                        {/if}
                    </div>

                    <div class="content-header">
                        <h3 class="icon-head head-products">Audios - Edit Video</h3>
                        <p class="content-buttons form-buttons">
                            <button  id="id_be616be1324d8ae4516f276d17d34b9c" type="button" class="scalable save" onclick="return checkuploadForm();" style=""><span>Save Changes</span></button>			
                        </p>
                    </div>
                    <!-- return checkuploadForm(); document.main_form.submit(); -->
                    <form action="audios_edit.php?AUDIOID={$smarty.request.AUDIOID}" method="post" id="main_form" name="main_form" enctype="multipart/form-data" onsubmit="alert('124567');">
                        <input type="hidden" id="submitform" name="submitform" value="1" >
                        <input type="hidden" id="AudioDate" name="AudioDate" value="{$audio.date_added}" >
                        <input type="hidden" id="AudioExt" name="AudioExt" value="{$audio.extension}" >
                        <input type="hidden" id="AudioCategory" name="AudioCategory" value="{$audio.categories}" >
                        
                        <div style="display:none"></div>
                    </form>
                </div>
            </div>
        </div>

    </div>
</div>